#pragma once

// SAPI includes
#include <sapi.h>           
#include <sphelper.h>
#include <spuihelp.h>

#include <string>
#include <fstream>

#include "HXTTSEngine.h"
#include "HXUtil.h"

using namespace std;

class HXTTSEngineSAPI : public HXTTSEngine
{
public:
	HXTTSEngineSAPI(void);
	~HXTTSEngineSAPI(void);

	static void GenerateSpeechOnly(const wstring& text);

private:
	HRESULT InitSAPI();


	// voice variables
	WCHAR               **m_ppszTokenIds;
	int					m_numTokenIds;
	vector<string>      m_voices;
	int                 m_voiceIndex;

	void PopulateVoices();

	// functions to override
	HRESULT GenerateSpeech(const wstring& text, string& audio, vector<vector<HXViseme>>& frames);
	void    GetVoices(vector<string>& voices);
	void    SetVoice(string& voice);
	void    SetEffect(string& effect, string& value);

	static string aMapVisemeToImage[22];
	static string aMapChinesePhonemeToImage[424];
};
